<div class="control-group {$name} files_upload" id="up_{$name}" rel="0">
    <label class="control-label">{$tca.label}</label>
	<div class="controls">
        <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
        <div class="row fileupload-buttonbar">
            <div class="col-lg-7">
                <!-- The fileinput-button span is used to style the file input field as button -->
                <span class="btn green fileinput-button">
                    <i class="fa fa-plus"></i>
                    <span>添加图片...</span>
                    <input type="file" name="files[]" multiple>
                </span>
                <button class="btn blue start hide">
                    <i class="fa fa-upload"></i>
                    <span>开始上传</span>
                </button>
                <button type="reset" class="btn yellow cancel hide">
                    <i class="fa fa-ban"></i>
                    <span>取消上传</span>
                </button>
                <!-- The loading indicator is shown during file processing -->
                <span class="fileupload-loading"></span>
            </div>
            <!-- The global progress information -->
<!--            <div class="col-lg-5 fileupload-progress fade">
                 The global progress bar 
                <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                    <div class="progress-bar progress-bar-success" style="width:0%;"></div>
                </div>
                 The extended global progress information 
                <div class="progress-extended">&nbsp;</div>
            </div>-->
        </div>
        <!-- The table listing the files available for upload/download -->
        <table role="presentation" class="table table-striped file-list clearfix">
            <tbody class="files"></tbody>
        </table>
    </div>
    <div class="controls">
        <table class="table table-striped file-list clearfix" role="presentation">
            <tbody>
			
            <volist name="tca['data']" id="vo">
			<tr>
                <td>
                    <a download="{$vo.name}" data-gallery="gallery" title="{$vo.title}" href="{$vo.path}">{$vo.title}</a>
                </td>
                <td>
                    <div class="btn red-stripe mini delete_attach" rel="{$vo.id}" model="{$Think.MODULE_NAME}">
                        <i class="icon-trash icon-white"></i>
                        <span>删除</span>
                    </div>
                </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>

    
</div>
<script id="template-upload" type="text/x-tmpl">
    {% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td class="preview"><span class="fade"></span></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        {% if (file.error) { %}
        <td class="error" colspan="2"><span class="label label-important">错误</span> {%=file.error%}</td>
        {% } else if (o.files.valid && !i) { %}
        <td>
            <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
        </td>
        <td class="start hide">{% if (!o.options.autoUpload) { %}
            <button class="btn">
                <i class="icon-upload icon-white"></i>
                <span>开始</span>
            </button>
            {% } %}</td>
        {% } else { %}
        <td colspan="2"></td>
        {% } %}
        <td class="cancel">{% if (!i) { %}
            <button class="btn red mini">
                <i class="icon-ban-circle icon-white"></i>
                <span>删除</span>
            </button>
            <input class="upfiles_add" type="hidden" value="1" />
            {% } %}</td>
    </tr>
    {% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
    {% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        {% if (file.error) { %}
        <td></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
        {% } else { %}
        <td class="preview">
            {% if (file.url) { %}
            <a class="fancybox-button" data-rel="fancybox-button" href="{%=file.url%}" title="{%=file.name%}">
                <img width="80" height="80" src="{%=file.url%}">
            </a>
            {% } %}</td>
        <td class="name">
            <a href="{%=file.url%}" title="{%=file.title%}" data-gallery="{%=file.url&&'gallery'%}" download="{%=file.name%}">{%=file.title%}</a>
        </td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        <td colspan="2"></td>
        {% } %}
        <td class="delete">
            <button class="btn red mini" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"{% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                    <i class="icon-trash icon-white"></i>
                <span>删除</span>
            </button>
        </td>
    </tr>
    <input type="hidden" name="{$name}[]" value="{%=file.name%}/{%=file.title%}" >
    {% } %}
</script>